﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace Lib
{
    public class Log
    {
        public static string log_file = "log.bin";
        public static void WriteLog(string log,string mod)
        {
            StreamWriter w;
            if (!File.Exists(log_file))
            {
                w = new StreamWriter(log_file);
            }
            else
            {
                w = File.AppendText(log_file);
            }
            w.WriteLine(DateTime.Now.ToString());
            w.WriteLine(mod);
            w.WriteLine(log);
            w.WriteLine("-----------------------------------------------------------------------------");
            w.Close();
        }
        public static void WriteLog(string log, string mod,string link)
        {
            StreamWriter w;
            if (!File.Exists(link+log_file))
            {
                w = new StreamWriter(link + log_file);
            }
            else
            {
                w = File.AppendText(link + log_file);
            }
            w.WriteLine(DateTime.Now.ToString());
            w.WriteLine(mod);
            w.WriteLine(log);
            w.WriteLine("-----------------------------------------------------------------------------");
            w.Close();
        }
    }
}
